<?php get_header(); ?>

	<div id="content" class="narrowcolumn">

		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
		<div class="post" id="post-<?php the_ID(); ?>">
		<h2><?php the_title(); ?></h2>
			<div class="entry">
				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>

				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

			</div>
		</div>
		<?php endwhile; endif; ?>
	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
	
    <?php 
        if(get_the_title() == 'Index'){
            echo '<div id="latest"><h2>Latest News</h2>';
            $posts = get_posts(null); 
            foreach($posts as $post){
                $post->post_content = strip_tags($post->post_content);
                echo '<h3><a href="'.$post->guid.'">'. date('F j, Y', strtotime($post->post_date)) .' - '. $post->post_title .'</a></h3>';
                echo '<p class="post">'.substr($post->post_content, 0, 260).'... <a href="'.$post->guid.'">read more</a></p>';
            }
            echo '</div>';
        }
    ?>
    </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>